package org.example.dyscript.dynamicscript;

import java.util.Map;

public class JavaRule implements Rule {

  public boolean execute(Map<String, Object> parameters) {
    Integer aliScore = (Integer) parameters.get("ali_score");
    Integer wxScore = (Integer) parameters.get("wx_score");
    String pd_living_province = (String) parameters.get("pd_living_province");
    String pd_census_province = (String) parameters.get("pd_census_province");

    return aliScore > 100
        && wxScore < 450
        && !pd_living_province.contains("乌克兰")
        && pd_census_province.contains("吉尔吉斯斯坦");
  }

  public boolean evaluate(Map<String, Object> parameters) {
    Integer age = (Integer) parameters.get("age");
    String vip = (String) parameters.get("vip");
    return age > 18 && vip.contains("vip");
  }
}
